<div class="book-body">
    <div class="body-inner">
        <div class="page-wrapper" tabindex="-1" role="main">
            <div class="page-inner">
                <div id="book-search-results">
                    <div class="search-noresults">
                        <section class="normal markdown-section">
                            <h1 id="基础组件">{$data.title}
                                <if condition="($admin_user.edit_permission eq 1) or ($admin_user.type eq 0)">
                                    <a href="{:U('Doc/editApi')}?id={$data.id}&proid={$proid}" style="margin-left: 2rem;"><i class="fa fa-edit" title="修改一下" style="cursor:pointer;color: black;"></i></a>
                                    <a class="delApi" style="margin-left: 2rem;" data-id="{$data.id}"><i class="fa fa-trash-o" title="删除" style="cursor:pointer;color: black;"></i></a>
                                </if>
                            </h1>
                            <div style='float:right;width:450px;height: 150px;overflow-y: scroll;'>
                                <table style='margin: 0;'>
                                    <tbody>
                                        <volist name="data.record" id="dk">
                                            <tr style='background-color: #F5FFE8'>
                                                <td>{$dk.create_time_str}</td>
                                                <td>{$dk.content}</td>
                                            </tr>
                                        </volist>
                                    </tbody>
                                </table>
                            </div>
                            <p>接口描述：{$data.desc|default='无'}</p>

                            <p>接口链接：{$data.url}</p>

                            <p>请求方式：{$data.request_type}</p>

                            <p>调用示例：<a style="display: inline;" target="_blank" href="{$data.exam_url}">{$data.exam_url|default='无'}</a>
                            </p>
                            <h3 id="共同属性类型">传参</h3>
                            <table>
                                <thead>
                                    <tr>
                                        <th>名称</th>
                                        <th>类型</th>
                                        <th>描述</th>
                                        <th>必填</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <volist name="data.params" id="send">
                                        <tr>
                                            <td>{$send.p_name}</td>
                                            <td>{$send.p_type}</td>
                                            <td>{$send.p_desc}</td>
                                            <td><if condition="$send.p_must eq 1">是<else />否</if></td>
                                        </tr>
                                    </volist>
                                </tbody>
                            </table>
                            <h3 id="共同属性类型">返回参数</h3>
                            <pre><code class='lang-json'>{$data.json_str}</code></pre>
                        </section>
                    </div>
                    <div class="search-results" >
                        <div class="has-results" style="display: none">
                            
                            <h1 class="search-results-title"><span class="search-results-count"></span> 个结果 "<span class="search-query"></span>"</h1>
                            <ul class="search-results-list">
                                <li class="search-results-item">
                                    <h3>
                                        <a href="/miniprogram/dev/api/canvas/arc.html?search-key=x">arc·小程序</a>
                                    </h3>
                                </li>
                            </ul>
                            
                        </div>
                        <div class="no-results" style="display: none">
                            <h1 class="search-results-title">没有找到相关内容 "<span class="search-query"></span>"</h1>
                            
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
        //删除接口
        $('.delApi').click(function () {
            if(!confirm('确定要删除该接口!？')){
                return false;
            }
            $('#waiting').show();
            $.post('{:U("Doc/delApi")}',{id:$(this).attr('data-id')},function (ret) {
                if(ret.status==200){
                    window.location.href='{:U("Doc/index")}?proid={$proid}';
                }else{
                    alert(ret.message);
                }
                $('#waiting').hide();
            },'json');

        });
</script>